package cn.tedu.blog.server.security;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @Author: 雷茂林
 * @Date:2022/7/16 9:03
 * @Description: 自定义类，用于邓庄可能会使用到的用户信息
 */
@Setter
@Getter
@ToString(callSuper = true)
@EqualsAndHashCode
public class UserDetails extends User {

    private Long id;

    public UserDetails(
            String username,
            String password,
            boolean enabled,
            Collection<? extends GrantedAuthority> authorities
    ) {
        super(
                username,
                password,
                enabled,
                true,
                true,
                true,
                authorities);
    }
}
